package com.zy.cat.entity.mall;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Index;
import javax.persistence.Table;

import com.zy.cat.entity.primary.CatGoodsSubsidyHistoryPrimary;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name = "zy_cat_goods_subsidy_history", indexes = {
		@Index(name = "pid", columnList = "pid"),
		@Index(name = "sid", columnList = "sid"),
		@Index(name = "rid", columnList = "rid"),
		@Index(name = "oid", columnList = "oid"),
		@Index(name = "ftype", columnList = "ftype"),
		@Index(name = "bstatus", columnList = "bstatus"),
		@Index(name = "ltime", columnList = "ltime"),
		@Index(name = "ctime", columnList = "ctime") })
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("9趣猫商品补贴红包实体类")
@IdClass(CatGoodsSubsidyHistoryPrimary.class)
public class CatGoodsSubsidyHistory {
	
	@Id
	@Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '用户账号ID'")
	@ApiModelProperty(value = "用户账号ID", example = "fe53d6a4fa29641")
	private String pid;
	
	@Id
	@Column(columnDefinition = "VARCHAR(32) NOT NULL COMMENT '商品ID'")
	@ApiModelProperty(value = "商品ID", example = "fe53d6a4fa29641")
	private String sid;
	
	@Id
	@Column(columnDefinition = "BIGINT(10) NOT NULL COMMENT '商品补贴红包（分）'")
	@ApiModelProperty(value = "商品补贴红包（分）", example = "300")
	private long fcode;
	
	@Id
	@Column(columnDefinition = "VARCHAR(30) DEFAULT '-'  COMMENT '订单号'")
	@ApiModelProperty(value = "订单号", example = "")
	private String oid="-";
	
	@Column(columnDefinition = "INT(1) NOT NULL COMMENT '订单类型(0.0元购、1.3元无门槛、2.15元无门槛、3.大额券订单、4.9.9订单)'")
	@ApiModelProperty(value = "订单类型(0.0元购、1.3元无门槛、2.15元无门槛、3.大额券订单、4.9.9订单)", example = "300")
	private int ftype;
	
	@Column(columnDefinition = "VARCHAR(32) NOT NULL COMMENT '用户渠道ID'")
	@ApiModelProperty(value = "用户渠道ID", example = "fe53d6a4fa29641")
	private String rid;
	
	@Column(columnDefinition = "VARCHAR(20) NOT NULL  COMMENT '创建时间[9趣猫商品补贴红包实体类]'")
	@ApiModelProperty(value = "创建时间", example = "2019-02-22 12:56:56:666")
	private String ctime;
	
	@Column(columnDefinition = "BIGINT(10) DEFAULT '0' COMMENT '商品补贴状态[-1.禁止补贴(不符合补贴规范)、0.待更新(订单未更新)、1.补贴中(订单已付款)、2.已补贴(订单确认收货)]'")
	@ApiModelProperty(value = "商品补贴状态[-1.禁止补贴(不符合补贴规范)、0.待更新(订单未更新)、1.补贴中(订单已付款)、2.已补贴(订单确认收货)]", example = "0")
	private int bstatus;
	
	@Column(columnDefinition = "INT(1) NOT NULL COMMENT '系统类型(0.Android、1.IOS、2.其他)'")
	@ApiModelProperty(value = "系统类型(0.Android、1.IOS、2.其他)", example = "300")
	private int rtype;
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '最后更改时间'")
	@ApiModelProperty(value = "最后更改时间", example = "2019-02-22 12:56:56:666")
	private String ltime;

	public CatGoodsSubsidyHistory(String pid,int ftype, String sid, long fcode, String rid, String ctime, int bstatus,
			String ltime) {
		super();
		this.pid = pid;
		this.ftype = ftype;
		this.sid = sid;
		this.fcode = fcode;
		this.rid = rid;
		this.ctime = ctime;
		this.bstatus = bstatus;
		this.ltime = ltime;
	}
}
